package com.aigou.admin.aigouspringboot.mapper;

import com.aigou.admin.aigouspringboot.entity.ShopCartProduct;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ShopCartProductMapper {
    int deleteByPrimaryKey(String id);

    int insertSelective(ShopCartProduct record);

    ShopCartProduct selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(ShopCartProduct record);

    int updateByPrimaryKey(ShopCartProduct record);
    
    List<ShopCartProduct> selectAll();

    List<ShopCartProduct> selectByUserId(String userId);

    // 根据购物车ID更新商品数量
    int updateProductNum(@Param("id") String id, @Param("productNum") Integer productNum);

    //根据购物车ID多选删除购物车
    int deleteByPrimaryKeys(@Param("ids") List<String> ids);

    int insertProduct(ShopCartProduct shopCartProduct);

    List<ShopCartProduct> selectProductByCartId(@Param("cartId") String cartId);

    ShopCartProduct selectProductByCartIdAndProductId(@Param("cartId") String cartId, @Param("productId") String productId);


}